<script setup>
import { RouterLink, RouterView } from "vue-router";
import HelloWorld from "./components/HelloWorld.vue";
</script>

<template>
  <div>
    <div class="header">
      <router-link to="/list" class="header-title">的电商网站</router-link>
      <div class="header-menu">
        <router-link to="/cart" class="header-menu-cart">
          购物车
          <span v-if="this.count">{{this.count}}</span>
        </router-link>
      </div>
    </div>

    <RouterView />
  </div>
</template>
<script>
import { mapState } from "pinia";
import { useCounterStore } from "./store/counter";
export default {
  computed: {
    ...mapState(useCounterStore, ["count"])
  }
};
</script>
<style scoped>
</style>
